import 'dart:convert';

/// createBy : "admin"
/// createTime : "2023-07-27 15:51:42"
/// updateBy : "admin"
/// updateTime : "2023-09-12 15:38:00"
/// remark : "1"
/// userId : 68
/// orgId : 152
/// userName : "heifazuzhiadmin"
/// nickName : "黑发组织admin"
/// email : ""
/// phone : ""
/// sex : "0"
/// avatar : ""
/// password : null
/// status : "0"
/// delFlag : "0"
/// loginIp : ""
/// loginDate : null
/// defaultSiteId : null
/// org : {"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"orgId":152,"parentId":null,"ancestors":null,"orgName":"黑发组织","orderNum":null,"leader":null,"email":null,"status":null,"delFlag":null,"linkman":null,"phone":null,"landlineNumber":null,"address":null,"longitude":null,"latitude":null,"parentName":null,"type":0}
/// orgType : 0
/// sideType : null
/// createByName : "系统管理员"
/// updateByName : "系统管理员"
/// roles : [{"createBy":null,"createTime":"2023-07-11 13:43:00","updateBy":"admin","updateTime":"2023-07-28 09:31:54","remark":null,"roleId":17,"roleName":"黑发角色","roleKey":null,"roleSort":100,"dataScope":"7","menuCheckStrictly":false,"orgCheckStrictly":false,"status":"0","delFlag":"0","type":1,"orgId":100,"homeMenuId":null,"orgName":null,"flag":false,"menuIds":null,"orgIds":null,"permissions":null,"updateByName":null}]
/// orgName : "黑发组织"

UserManagerModel userManagerModelFromJson(String str) =>
    UserManagerModel.fromJson(json.decode(str));
String userManagerModelToJson(UserManagerModel data) =>
    json.encode(data.toJson());

class UserManagerModel {
  UserManagerModel({
    String? createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    String? remark,
    num? userId,
    num? orgId,
    String? userName,
    String? nickName,
    String? email,
    String? phone,
    String? sex,
    String? avatar,
    dynamic password,
    String? status,
    String? delFlag,
    String? loginIp,
    dynamic loginDate,
    dynamic defaultSiteId,
    Org? org,
    num? orgType,
    dynamic sideType,
    String? createByName,
    String? updateByName,
    List<Roles>? roles,
    String? orgName,
  }) {
    _createBy = createBy;
    _createTime = createTime;
    _updateBy = updateBy;
    _updateTime = updateTime;
    _remark = remark;
    _userId = userId;
    _orgId = orgId;
    _userName = userName;
    _nickName = nickName;
    _email = email;
    _phone = phone;
    _sex = sex;
    _avatar = avatar;
    _password = password;
    _status = status;
    _delFlag = delFlag;
    _loginIp = loginIp;
    _loginDate = loginDate;
    _defaultSiteId = defaultSiteId;
    _org = org;
    _orgType = orgType;
    _sideType = sideType;
    _createByName = createByName;
    _updateByName = updateByName;
    _roles = roles;
    _orgName = orgName;
  }

  UserManagerModel.fromJson(dynamic json) {
    _createBy = json['createBy'];
    _createTime = json['createTime'];
    _updateBy = json['updateBy'];
    _updateTime = json['updateTime'];
    _remark = json['remark'];
    _userId = json['userId'];
    _orgId = json['orgId'];
    _userName = json['userName'];
    _nickName = json['nickName'];
    _email = json['email'];
    _phone = json['phone'];
    _sex = json['sex'];
    _avatar = json['avatar'];
    _password = json['password'];
    _status = json['status'];
    _delFlag = json['delFlag'];
    _loginIp = json['loginIp'];
    _loginDate = json['loginDate'];
    _defaultSiteId = json['defaultSiteId'];
    _org = json['org'] != null ? Org.fromJson(json['org']) : null;
    _orgType = json['orgType'];
    _sideType = json['sideType'];
    _createByName = json['createByName'];
    _updateByName = json['updateByName'];
    if (json['roles'] != null) {
      _roles = [];
      json['roles'].forEach((v) {
        _roles?.add(Roles.fromJson(v));
      });
    }
    _orgName = json['orgName'];
  }
  String? _createBy;
  String? _createTime;
  String? _updateBy;
  String? _updateTime;
  String? _remark;
  num? _userId;
  num? _orgId;
  String? _userName;
  String? _nickName;
  String? _email;
  String? _phone;
  String? _sex;
  String? _avatar;
  dynamic _password;
  String? _status;
  String? _delFlag;
  String? _loginIp;
  dynamic _loginDate;
  dynamic _defaultSiteId;
  Org? _org;
  num? _orgType;
  dynamic _sideType;
  String? _createByName;
  String? _updateByName;
  List<Roles>? _roles;
  String? _orgName;
  UserManagerModel copyWith({
    String? createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    String? remark,
    num? userId,
    num? orgId,
    String? userName,
    String? nickName,
    String? email,
    String? phone,
    String? sex,
    String? avatar,
    dynamic password,
    String? status,
    String? delFlag,
    String? loginIp,
    dynamic loginDate,
    dynamic defaultSiteId,
    Org? org,
    num? orgType,
    dynamic sideType,
    String? createByName,
    String? updateByName,
    List<Roles>? roles,
    String? orgName,
  }) =>
      UserManagerModel(
        createBy: createBy ?? _createBy,
        createTime: createTime ?? _createTime,
        updateBy: updateBy ?? _updateBy,
        updateTime: updateTime ?? _updateTime,
        remark: remark ?? _remark,
        userId: userId ?? _userId,
        orgId: orgId ?? _orgId,
        userName: userName ?? _userName,
        nickName: nickName ?? _nickName,
        email: email ?? _email,
        phone: phone ?? _phone,
        sex: sex ?? _sex,
        avatar: avatar ?? _avatar,
        password: password ?? _password,
        status: status ?? _status,
        delFlag: delFlag ?? _delFlag,
        loginIp: loginIp ?? _loginIp,
        loginDate: loginDate ?? _loginDate,
        defaultSiteId: defaultSiteId ?? _defaultSiteId,
        org: org ?? _org,
        orgType: orgType ?? _orgType,
        sideType: sideType ?? _sideType,
        createByName: createByName ?? _createByName,
        updateByName: updateByName ?? _updateByName,
        roles: roles ?? _roles,
        orgName: orgName ?? _orgName,
      );
  String? get createBy => _createBy;
  String? get createTime => _createTime;
  String? get updateBy => _updateBy;
  String? get updateTime => _updateTime;
  String? get remark => _remark;
  num? get userId => _userId;
  num? get orgId => _orgId;
  String? get userName => _userName;
  String? get nickName => _nickName;
  String? get email => _email;
  String? get phone => _phone;
  String? get sex => _sex;
  String? get avatar => _avatar;
  dynamic get password => _password;
  String? get status => _status;
  String? get delFlag => _delFlag;
  String? get loginIp => _loginIp;
  dynamic get loginDate => _loginDate;
  dynamic get defaultSiteId => _defaultSiteId;
  Org? get org => _org;
  num? get orgType => _orgType;
  dynamic get sideType => _sideType;
  String? get createByName => _createByName;
  String? get updateByName => _updateByName;
  List<Roles>? get roles => _roles;
  String? get orgName => _orgName;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['createBy'] = _createBy;
    map['createTime'] = _createTime;
    map['updateBy'] = _updateBy;
    map['updateTime'] = _updateTime;
    map['remark'] = _remark;
    map['userId'] = _userId;
    map['orgId'] = _orgId;
    map['userName'] = _userName;
    map['nickName'] = _nickName;
    map['email'] = _email;
    map['phone'] = _phone;
    map['sex'] = _sex;
    map['avatar'] = _avatar;
    map['password'] = _password;
    map['status'] = _status;
    map['delFlag'] = _delFlag;
    map['loginIp'] = _loginIp;
    map['loginDate'] = _loginDate;
    map['defaultSiteId'] = _defaultSiteId;
    if (_org != null) {
      map['org'] = _org?.toJson();
    }
    map['orgType'] = _orgType;
    map['sideType'] = _sideType;
    map['createByName'] = _createByName;
    map['updateByName'] = _updateByName;
    if (_roles != null) {
      map['roles'] = _roles?.map((v) => v.toJson()).toList();
    }
    map['orgName'] = _orgName;
    return map;
  }
}

/// createBy : null
/// createTime : "2023-07-11 13:43:00"
/// updateBy : "admin"
/// updateTime : "2023-07-28 09:31:54"
/// remark : null
/// roleId : 17
/// roleName : "黑发角色"
/// roleKey : null
/// roleSort : 100
/// dataScope : "7"
/// menuCheckStrictly : false
/// orgCheckStrictly : false
/// status : "0"
/// delFlag : "0"
/// type : 1
/// orgId : 100
/// homeMenuId : null
/// orgName : null
/// flag : false
/// menuIds : null
/// orgIds : null
/// permissions : null
/// updateByName : null

Roles rolesFromJson(String str) => Roles.fromJson(json.decode(str));
String rolesToJson(Roles data) => json.encode(data.toJson());

class Roles {
  Roles({
    dynamic createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    dynamic remark,
    num? roleId,
    String? roleName,
    dynamic roleKey,
    num? roleSort,
    String? dataScope,
    bool? menuCheckStrictly,
    bool? orgCheckStrictly,
    String? status,
    String? delFlag,
    num? type,
    num? orgId,
    dynamic homeMenuId,
    dynamic orgName,
    bool? flag,
    dynamic menuIds,
    dynamic orgIds,
    dynamic permissions,
    dynamic updateByName,
  }) {
    _createBy = createBy;
    _createTime = createTime;
    _updateBy = updateBy;
    _updateTime = updateTime;
    _remark = remark;
    _roleId = roleId;
    _roleName = roleName;
    _roleKey = roleKey;
    _roleSort = roleSort;
    _dataScope = dataScope;
    _menuCheckStrictly = menuCheckStrictly;
    _orgCheckStrictly = orgCheckStrictly;
    _status = status;
    _delFlag = delFlag;
    _type = type;
    _orgId = orgId;
    _homeMenuId = homeMenuId;
    _orgName = orgName;
    _flag = flag;
    _menuIds = menuIds;
    _orgIds = orgIds;
    _permissions = permissions;
    _updateByName = updateByName;
  }

  Roles.fromJson(dynamic json) {
    _createBy = json['createBy'];
    _createTime = json['createTime'];
    _updateBy = json['updateBy'];
    _updateTime = json['updateTime'];
    _remark = json['remark'];
    _roleId = json['roleId'];
    _roleName = json['roleName'];
    _roleKey = json['roleKey'];
    _roleSort = json['roleSort'];
    _dataScope = json['dataScope'];
    _menuCheckStrictly = json['menuCheckStrictly'];
    _orgCheckStrictly = json['orgCheckStrictly'];
    _status = json['status'];
    _delFlag = json['delFlag'];
    _type = json['type'];
    _orgId = json['orgId'];
    _homeMenuId = json['homeMenuId'];
    _orgName = json['orgName'];
    _flag = json['flag'];
    _menuIds = json['menuIds'];
    _orgIds = json['orgIds'];
    _permissions = json['permissions'];
    _updateByName = json['updateByName'];
  }
  dynamic _createBy;
  String? _createTime;
  String? _updateBy;
  String? _updateTime;
  dynamic _remark;
  num? _roleId;
  String? _roleName;
  dynamic _roleKey;
  num? _roleSort;
  String? _dataScope;
  bool? _menuCheckStrictly;
  bool? _orgCheckStrictly;
  String? _status;
  String? _delFlag;
  num? _type;
  num? _orgId;
  dynamic _homeMenuId;
  dynamic _orgName;
  bool? _flag;
  dynamic _menuIds;
  dynamic _orgIds;
  dynamic _permissions;
  dynamic _updateByName;
  Roles copyWith({
    dynamic createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    dynamic remark,
    num? roleId,
    String? roleName,
    dynamic roleKey,
    num? roleSort,
    String? dataScope,
    bool? menuCheckStrictly,
    bool? orgCheckStrictly,
    String? status,
    String? delFlag,
    num? type,
    num? orgId,
    dynamic homeMenuId,
    dynamic orgName,
    bool? flag,
    dynamic menuIds,
    dynamic orgIds,
    dynamic permissions,
    dynamic updateByName,
  }) =>
      Roles(
        createBy: createBy ?? _createBy,
        createTime: createTime ?? _createTime,
        updateBy: updateBy ?? _updateBy,
        updateTime: updateTime ?? _updateTime,
        remark: remark ?? _remark,
        roleId: roleId ?? _roleId,
        roleName: roleName ?? _roleName,
        roleKey: roleKey ?? _roleKey,
        roleSort: roleSort ?? _roleSort,
        dataScope: dataScope ?? _dataScope,
        menuCheckStrictly: menuCheckStrictly ?? _menuCheckStrictly,
        orgCheckStrictly: orgCheckStrictly ?? _orgCheckStrictly,
        status: status ?? _status,
        delFlag: delFlag ?? _delFlag,
        type: type ?? _type,
        orgId: orgId ?? _orgId,
        homeMenuId: homeMenuId ?? _homeMenuId,
        orgName: orgName ?? _orgName,
        flag: flag ?? _flag,
        menuIds: menuIds ?? _menuIds,
        orgIds: orgIds ?? _orgIds,
        permissions: permissions ?? _permissions,
        updateByName: updateByName ?? _updateByName,
      );
  dynamic get createBy => _createBy;
  String? get createTime => _createTime;
  String? get updateBy => _updateBy;
  String? get updateTime => _updateTime;
  dynamic get remark => _remark;
  num? get roleId => _roleId;
  String? get roleName => _roleName;
  dynamic get roleKey => _roleKey;
  num? get roleSort => _roleSort;
  String? get dataScope => _dataScope;
  bool? get menuCheckStrictly => _menuCheckStrictly;
  bool? get orgCheckStrictly => _orgCheckStrictly;
  String? get status => _status;
  String? get delFlag => _delFlag;
  num? get type => _type;
  num? get orgId => _orgId;
  dynamic get homeMenuId => _homeMenuId;
  dynamic get orgName => _orgName;
  bool? get flag => _flag;
  dynamic get menuIds => _menuIds;
  dynamic get orgIds => _orgIds;
  dynamic get permissions => _permissions;
  dynamic get updateByName => _updateByName;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['createBy'] = _createBy;
    map['createTime'] = _createTime;
    map['updateBy'] = _updateBy;
    map['updateTime'] = _updateTime;
    map['remark'] = _remark;
    map['roleId'] = _roleId;
    map['roleName'] = _roleName;
    map['roleKey'] = _roleKey;
    map['roleSort'] = _roleSort;
    map['dataScope'] = _dataScope;
    map['menuCheckStrictly'] = _menuCheckStrictly;
    map['orgCheckStrictly'] = _orgCheckStrictly;
    map['status'] = _status;
    map['delFlag'] = _delFlag;
    map['type'] = _type;
    map['orgId'] = _orgId;
    map['homeMenuId'] = _homeMenuId;
    map['orgName'] = _orgName;
    map['flag'] = _flag;
    map['menuIds'] = _menuIds;
    map['orgIds'] = _orgIds;
    map['permissions'] = _permissions;
    map['updateByName'] = _updateByName;
    return map;
  }
}

/// createBy : null
/// createTime : null
/// updateBy : null
/// updateTime : null
/// remark : null
/// orgId : 152
/// parentId : null
/// ancestors : null
/// orgName : "黑发组织"
/// orderNum : null
/// leader : null
/// email : null
/// status : null
/// delFlag : null
/// linkman : null
/// phone : null
/// landlineNumber : null
/// address : null
/// longitude : null
/// latitude : null
/// parentName : null
/// type : 0

Org orgFromJson(String str) => Org.fromJson(json.decode(str));
String orgToJson(Org data) => json.encode(data.toJson());

class Org {
  Org({
    dynamic createBy,
    dynamic createTime,
    dynamic updateBy,
    dynamic updateTime,
    dynamic remark,
    num? orgId,
    dynamic parentId,
    dynamic ancestors,
    String? orgName,
    dynamic orderNum,
    dynamic leader,
    dynamic email,
    dynamic status,
    dynamic delFlag,
    dynamic linkman,
    dynamic phone,
    dynamic landlineNumber,
    dynamic address,
    dynamic longitude,
    dynamic latitude,
    dynamic parentName,
    num? type,
  }) {
    _createBy = createBy;
    _createTime = createTime;
    _updateBy = updateBy;
    _updateTime = updateTime;
    _remark = remark;
    _orgId = orgId;
    _parentId = parentId;
    _ancestors = ancestors;
    _orgName = orgName;
    _orderNum = orderNum;
    _leader = leader;
    _email = email;
    _status = status;
    _delFlag = delFlag;
    _linkman = linkman;
    _phone = phone;
    _landlineNumber = landlineNumber;
    _address = address;
    _longitude = longitude;
    _latitude = latitude;
    _parentName = parentName;
    _type = type;
  }

  Org.fromJson(dynamic json) {
    _createBy = json['createBy'];
    _createTime = json['createTime'];
    _updateBy = json['updateBy'];
    _updateTime = json['updateTime'];
    _remark = json['remark'];
    _orgId = json['orgId'];
    _parentId = json['parentId'];
    _ancestors = json['ancestors'];
    _orgName = json['orgName'];
    _orderNum = json['orderNum'];
    _leader = json['leader'];
    _email = json['email'];
    _status = json['status'];
    _delFlag = json['delFlag'];
    _linkman = json['linkman'];
    _phone = json['phone'];
    _landlineNumber = json['landlineNumber'];
    _address = json['address'];
    _longitude = json['longitude'];
    _latitude = json['latitude'];
    _parentName = json['parentName'];
    _type = json['type'];
  }
  dynamic _createBy;
  dynamic _createTime;
  dynamic _updateBy;
  dynamic _updateTime;
  dynamic _remark;
  num? _orgId;
  dynamic _parentId;
  dynamic _ancestors;
  String? _orgName;
  dynamic _orderNum;
  dynamic _leader;
  dynamic _email;
  dynamic _status;
  dynamic _delFlag;
  dynamic _linkman;
  dynamic _phone;
  dynamic _landlineNumber;
  dynamic _address;
  dynamic _longitude;
  dynamic _latitude;
  dynamic _parentName;
  num? _type;
  Org copyWith({
    dynamic createBy,
    dynamic createTime,
    dynamic updateBy,
    dynamic updateTime,
    dynamic remark,
    num? orgId,
    dynamic parentId,
    dynamic ancestors,
    String? orgName,
    dynamic orderNum,
    dynamic leader,
    dynamic email,
    dynamic status,
    dynamic delFlag,
    dynamic linkman,
    dynamic phone,
    dynamic landlineNumber,
    dynamic address,
    dynamic longitude,
    dynamic latitude,
    dynamic parentName,
    num? type,
  }) =>
      Org(
        createBy: createBy ?? _createBy,
        createTime: createTime ?? _createTime,
        updateBy: updateBy ?? _updateBy,
        updateTime: updateTime ?? _updateTime,
        remark: remark ?? _remark,
        orgId: orgId ?? _orgId,
        parentId: parentId ?? _parentId,
        ancestors: ancestors ?? _ancestors,
        orgName: orgName ?? _orgName,
        orderNum: orderNum ?? _orderNum,
        leader: leader ?? _leader,
        email: email ?? _email,
        status: status ?? _status,
        delFlag: delFlag ?? _delFlag,
        linkman: linkman ?? _linkman,
        phone: phone ?? _phone,
        landlineNumber: landlineNumber ?? _landlineNumber,
        address: address ?? _address,
        longitude: longitude ?? _longitude,
        latitude: latitude ?? _latitude,
        parentName: parentName ?? _parentName,
        type: type ?? _type,
      );
  dynamic get createBy => _createBy;
  dynamic get createTime => _createTime;
  dynamic get updateBy => _updateBy;
  dynamic get updateTime => _updateTime;
  dynamic get remark => _remark;
  num? get orgId => _orgId;
  dynamic get parentId => _parentId;
  dynamic get ancestors => _ancestors;
  String? get orgName => _orgName;
  dynamic get orderNum => _orderNum;
  dynamic get leader => _leader;
  dynamic get email => _email;
  dynamic get status => _status;
  dynamic get delFlag => _delFlag;
  dynamic get linkman => _linkman;
  dynamic get phone => _phone;
  dynamic get landlineNumber => _landlineNumber;
  dynamic get address => _address;
  dynamic get longitude => _longitude;
  dynamic get latitude => _latitude;
  dynamic get parentName => _parentName;
  num? get type => _type;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['createBy'] = _createBy;
    map['createTime'] = _createTime;
    map['updateBy'] = _updateBy;
    map['updateTime'] = _updateTime;
    map['remark'] = _remark;
    map['orgId'] = _orgId;
    map['parentId'] = _parentId;
    map['ancestors'] = _ancestors;
    map['orgName'] = _orgName;
    map['orderNum'] = _orderNum;
    map['leader'] = _leader;
    map['email'] = _email;
    map['status'] = _status;
    map['delFlag'] = _delFlag;
    map['linkman'] = _linkman;
    map['phone'] = _phone;
    map['landlineNumber'] = _landlineNumber;
    map['address'] = _address;
    map['longitude'] = _longitude;
    map['latitude'] = _latitude;
    map['parentName'] = _parentName;
    map['type'] = _type;
    return map;
  }
}
